package com.linxb.web;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.cloud.context.config.annotation.RefreshScope;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

/**
 * @Author: linxubin
 * @Description:
 * @Date: Created in 2018-07-02 11:28
 * @modified by:
 **/
@RestController
@RefreshScope
public class HiController {

    @Value("${foo}")
    private String foo;

    @GetMapping("/hi")
    public String sayHi(@RequestParam(value = "name", defaultValue = "linxubin", required = false) String name) {
        return "hello world," + name + "," + foo;
    }
}
